home *** CD-ROM | disk | FTP | other *** search
- <%@ Language=VBScript CODEPAGE=65001 %>
- <!--#include file="include/wmsConstants.inc"-->
- <!--#include file="include/wmsLocStrings.inc"-->
- <!--#include file="include/wmsCommon.inc"-->
- <!--#include file="include/wmsServerHash.inc"-->
- <!--#include file="include/wmsconnect.inc"-->
- <!--#include file="include/wmsError.inc"-->
- <%
- '+-------------------------------------------------------------------------
- '
- ' Microsoft Windows Media
- ' Copyright (C) Microsoft Corporation. All rights reserved.
- '
- ' File: PP_Action.asp
- '
- ' Contents:
- '
- '--------------------------------------------------------------------------
-
- ConnectToServer
- ConnectToPubPoint
-
- '
- ' Here, we collect a bunch of common code. This allows us to re-use code between multiple tabs simply
- ' by calling Request.Transfer pp_action.asp, etc.
- '
- on error resume next
- Dim strOp
- Dim bUpdateTreeView
- Dim qsSuffix
-
- bUpdateTreeView = FALSE
- qsSuffix = ""
-
- err.Clear
- strOp = lcase( RemoveDangerousCharacters( qs("op") ) )
-
- select case strOp
- case "start"
- PPStartStop "start"
- bUpdateTreeView = TRUE
- case "stop"
- PPStartStop "stop"
- bUpdateTreeView = TRUE
- case "startarchiving"
- PPStartStopArchiving "start"
- case "stoparchiving"
- PPStartStopArchiving "stop"
- case "rampdown"
- PPStartStop "rampdown"
- case "allow"
- PPAllowDeny "allow"
- bUpdateTreeView = TRUE
- case "deny"
- PPAllowDeny "deny"
- bUpdateTreeView = TRUE
- case "delete"
- PPDelete
- bUpdateTreeView = TRUE
- case Else
- if g_bDebugMode then
- STOP
- end if
- end select
-
- Session( "bUpdateTreeView" ) = bUpdateTreeView
- if( ErrorDetected( strOp ) ) then
- Session( "PageReloadedToDisplayError" ) = 1
- qsSuffix = "&error=" & Session( "ErrorNumber" )
- end if
-
- strReferrer = CStr( qs("referrer") )
- if( 0 = Len( strReferrer ) ) then
- Response.Redirect( "pubpoint_collection.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & qsSuffix )
- ' Don't do a server-side transfer, as we need to clean up the query string so that the refresh timer doesn't invoke redundant commands
- ' Server.Transfer( "pubpoint_collection.asp" )
- else
- if( 0 <> Session( "ErrorNumber" ) ) then
- Response.Redirect( SafeUnescape( strReferrer ) & "?" & qs & qsSuffix )
- else
- Server.Transfer( strReferrer )
- end if
- end if
-
- '/////////////////////////////////////////////////////////////////////////////////////
- ' PPDelete
- ' -------------
- ' Deletes a publishing point
- Sub PPDelete()
- g_objServer.PublishingPoints.Remove( g_objPubPoint.Name )
-
- if ErrorDetected( strOp ) then
- Session( "PageReloadedToDisplayError" ) = 1
- end if
-
- Session( "bUpdateTreeView" ) = 1
- Server.Transfer( "pubpoint_collection.asp" )
- end sub
-
- '/////////////////////////////////////////////////////////////////////////////////////
- ' PPStartStopArchiving
- ' -------------
- ' Starts or stops the archiving of a broadcast pub point
- sub PPStartStopArchiving( strOp )
-
- if( 0 = StrComp( "start", strOp, vbTextCompare ) ) then
- if( WMS_PUBLISHING_POINT_TYPE_BROADCAST = g_objPubPoint.Type ) then
- g_objPubPoint.StartArchive
- end if
- elseif ( 0 = StrComp( "stop", strOp, vbTextCompare ) ) then
- if( WMS_PUBLISHING_POINT_TYPE_BROADCAST = g_objPubPoint.Type ) then
- g_objPubPoint.StopArchive
- end if
- end if
-
- if( 0 <> Err.number ) then
- ErrorDetected( "archive" )
- Session( "PageReloadedToDisplayError" ) = 1
- end if
-
- if ErrorDetected( strOp ) then
- Session( "PageReloadedToDisplayError" ) = 1
- end if
- end sub
-
- '/////////////////////////////////////////////////////////////////////////////////////
- ' PPStartStop
- ' -------------
- ' Enables or disables a list of publishing points
- Sub PPStartStop( strOp)
- Dim i
- Dim bAllowingClientsToConnect
-
- if( 0 = StrComp( "start", strOp, vbTextCompare ) ) then
- if( WMS_PUBLISHING_POINT_TYPE_ON_DEMAND <> g_objPubPoint.Type ) then
- g_objPubPoint.Start
- end if
- elseif ( 0 = StrComp( "stop", strOp, vbTextCompare ) ) then
-
- bAllowingClientsToConnect = g_objPubPoint.AllowClientsToConnect
- g_objPubPoint.AllowClientsToConnect = FALSE
- if( WMS_PUBLISHING_POINT_TYPE_ON_DEMAND <> g_objPubPoint.Type ) then
- g_objPubPoint.Stop
- end if
- g_objPubPoint.AllowClientsToConnect = bAllowingClientsToConnect
-
- elseif ( 0 = StrComp( "rampdown", strOp, vbTextCompare ) ) then
- Dim players
- Dim aPlayer
- Dim dwNumPlayers
-
- bAllowingClientsToConnect = g_objPubPoint.AllowClientsToConnect
- g_objPubPoint.AllowClientsToConnect = FALSE
- set players = g_objPubPoint.Players
-
- dwNumPlayers = players.Count
- for i = ( dwNumPlayers - 1 ) to 0 step -1
- players.Remove( i )
- next
-
- for each player in players
- players.Remove( player )
- next
-
- g_objPubPoint.AllowClientsToConnect = bAllowingClientsToConnect
- err.clear
-
- end if
-
- if ErrorDetected( strOp ) then
- Session( "PageReloadedToDisplayError" ) = 1
- end if
- end sub
-
-
- '/////////////////////////////////////////////////////////////////////////////////////
- ' PPAllowDeny
- ' -------------
- ' Enables clients to connect or disables clients from connecting to a list of publishing points
- Sub PPAllowDeny( strOp )
- Dim bBroadcastPubPoint
- Dim dwPPType
-
- dwPPType = g_objPubPoint.Type
-
- if WMS_PUBLISHING_POINT_TYPE_BROADCAST = dwPPType then
- bBroadcastPubPoint = true
- end if
-
- if( 0 = StrComp( "allow", strOp, vbTextCompare ) ) then
- g_objPubPoint.AllowClientsToConnect = TRUE
- if not ErrorDetected( "PPAllowConnect" ) then
- if bBroadcastPubPoint then
- if ErrorDetected( "PPStart" ) then
- end if
- end if
- end if
- elseif( 0 = StrComp( "deny", strOp, vbTextCompare ) ) then
- g_objPubPoint.AllowClientsToConnect = FALSE
- if not ErrorDetected( "PPDenyConnect" ) then
- if bBroadcastPubPoint then
- if ErrorDetected( "PPStop" ) then
- end if
- end if
- end if
- end if
-
- if( 0 <> Err.number ) then
- ErrorDetected( "" )
- Session( "PageReloadedToDisplayError" ) = 1
- end if
- End Sub
-
- WMSServerHashASPCleanup
- WMSConnectASPCleanup
- %>
-